<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>茶叶上架</title>
<link rel="stylesheet" href="../css/main.css">
<link rel="stylesheet" href="../css/footer.css">
<link rel="stylesheet"
	href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script
	src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script
	src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script language="javascript" type="text/javascript">
	function check() {
		var stock = document.form.stock.value;
		var type = document.form.type.value;
		if(stock <= 0){
			alert("请输入大于0的库存!");
			return false;
		}else if(type <=0 || type > 6){
			alert("请输入正确的茶叶类型!");
			return false;
		}else{
			return true;
		}
	}
</script>
</head>
<body>
	<jsp:include page="navbar.jsp" />
	<jsp:include page="leftbar.jsp"/>
	<div class="py-5">
		<div class="container">
			<div class="row">
				<div class="col-md-12">
					<h1 class="display-1 text-center">茶叶信息</h1>
				</div>
			</div>
		</div>
		<div class="container">
			<div class="row">
				<div class="col-md-3"></div>
				<div class="col-md-6">
					<form action="teaAdder.action" method="post" name="form" onsubmit="return check()">
						<div class="form-group">
							<label>茶叶名称</label> <input type="text" class="form-control"
								placeholder="茶叶名称" name="name" id="name" required="required"/>
						</div>
						<div class="form-group">
							<label>茶叶产地</label> <input type="text" class="form-control"
								placeholder="产地" name="from" id="from" required="required"/>
						</div>
						<div class="form-group">
							<label>茶叶价格</label> <input type="text" class="form-control"
								placeholder="茶叶价格" name="price" id="price" required="required"/>
						</div>
						<div class="form-group">
							<label>茶叶库存</label> <input type="text" class="form-control"
								placeholder="茶叶库存" name="stock" id="stock" required="required"/>
						</div>
						<div class="form-group">
							<label>茶叶类型</label> <input type="text" class="form-control"
								placeholder="茶叶类型" name="type" id="type" required="required"/>
						</div>
						<div class="form-group">
							<label>茶叶简介</label> <input type="text" class="form-control"
								placeholder="茶叶简介" name="introduction" id="phone" required="required"/>
						</div>

						<div class="form-group">
							<button type="submit" class="btn btn-success">增加</button>
							<input type="button" class="btn btn-primary" name="button"
								value="返回" onclick="javascript:history.go(-1)" />
						</div>

					</form>
				</div>
				<font color="red">${requestScope.errorMessage}</font>
			</div>
		</div>
	</div>
</body>
</html>